import 'package:logger/logger.dart';

class Log {
  static void v(message, {bool showMethodCalls = false}) {
    if (showMethodCalls) {
      _logger.v(message);
      return;
    }
    _loggerNoStack.v(message);
  }

  static void d(message, {bool showMethodCalls = false}) {
    if (showMethodCalls) {
      _logger.d(message);
      return;
    }
    _loggerNoStack.d(message);
  }

  static void i(message, {bool showMethodCalls = false}) {
    if (showMethodCalls) {
      _logger.i(message);
      return;
    }
    _loggerNoStack.i(message);
  }

  static void w(message, {bool showMethodCalls = true}) {
    if (showMethodCalls) {
      _logger.w(message);
      return;
    }
    _loggerNoStack.w(message);
  }

  static void e(message, {bool showMethodCalls = true}) {
    if (showMethodCalls) {
      _logger.e(message);
      return;
    }
    _loggerNoStack.e(message);
  }

  static void wtf(message, {bool showMethodCalls = false}) {
    if (showMethodCalls) {
      _logger.wtf(message);
      return;
    }
    _loggerNoStack.wtf(message);
  }
}

final _logger = Logger(
  printer: PrettyPrinter(
    lineLength: 120,
    methodCount: 2,
  ),
);

final _loggerNoStack = Logger(
  printer: PrettyPrinter(
    methodCount: 0,
    lineLength: 120,
  ),
);
